package com.hack.validator.exceptions;


import com.hack.validator.ValidationResult;

import java.util.Map;

/**
 * 验证异常类
 * 包含验证结果和错误信息
 *
 * @author hack
 * @version 1.0
 * @date 2025/07/11
 */
public class ValidationException extends RuntimeException {
    private final Map<String, String> errors;

    public ValidationException(ValidationResult result) {
        super("Validation failed for " + result.getErrors().size() + " fields");
        this.errors = result.getErrors();
    }

    public Map<String, String> getErrors() {
        return errors;
    }
}